package com.xbongbong.paas.model.impl;

import com.xbongbong.paas.domain.dao.ProLinkBusinessDao;
import com.xbongbong.paas.domain.entity.ProLinkBusinessEntity;
import com.xbongbong.paas.model.ProLinkBusinessModel;
import com.xbongbong.paas.toolbox.exception.XbbException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author 吴峰
 * @version v1.0
 * @date 2019/10/30 14:45
 * @since v1.0
 */
@Service("proLinkBusinessModel")
public class ProLinkBusinessModelImpl implements ProLinkBusinessModel {

    private static final String COLUMNS = " id, corpid, attr, form_id, business_type, link_form_id, link_business_type, field, `condition`, creator_id, add_time, update_time, del ";

    @Resource
    private ProLinkBusinessDao proLinkBusinessDao;

    @Override
    public Integer insert(ProLinkBusinessEntity entity) throws XbbException {
        return proLinkBusinessDao.insert(entity);
    }

    @Override
    public Integer insertBatch(List<ProLinkBusinessEntity> list) {
       return proLinkBusinessDao.insertBatch(list);
    }

    @Override
    public Integer update(ProLinkBusinessEntity entity) throws XbbException {
        return proLinkBusinessDao.update(entity);
    }

    @Override
    public Integer updateBatch(List<ProLinkBusinessEntity> list, String corpid) {
        return proLinkBusinessDao.updateBatch(list, corpid);
    }

    @Override
    public List<ProLinkBusinessEntity> findEntitys(Map<String, Object> param) {
        param.put("columns", new StringBuffer(COLUMNS));
        return proLinkBusinessDao.findEntitys(param);
    }

    @Override
    public Integer getEntitysCount(Map<String, Object> param) {
        return proLinkBusinessDao.getEntitysCount(param);
    }

    @Override
    public List findEntitysWithoutSub(Map<String, Object> param) {
        return null;
    }
}
